package com.dongdong.controller;

import com.dongdong.result.Result;
import com.dongdong.service.ItemCatService;
import com.dongdong.vo.ItemCatVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/itemCat")
public class ItemCatController {

    @Autowired
    private ItemCatService itemCatService;

    /**
     * 查询类型
     * @param pid
     * @return
     */
    @GetMapping("/FindItemCatList")
    public Result FindItemCatList(@RequestParam Long pid){
        List<ItemCatVO> itemCatVOS = itemCatService.FindItemCatList(pid);
        return Result.OK().setData(itemCatVOS);
    }
}
